<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order', function (Blueprint $table) {
            $table->id();
            $table->string('order_sn')->comment('订单编号')->unique();
            $table->unsignedTinyInteger('order_type')->comment('订单类型[1:预约挂号2:线上复诊]')->unique();
            $table->integer('user_id')->comment('用户id');
            $table->unsignedTinyInteger('status')->comment('订单状态[0:未支付1:已支付2:已退款]');
            $table->decimal('money')->comment('支付金额');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order');
    }
}
